<<<<<<< HEAD
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7571c9ea-0624-4d92-9b58-4e87f98ff9c7",
   "metadata": {},
   "source": [
    "# 学习 LLM 的应用"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "32fd5b7e-652a-4062-949b-3a2f5a7a757d",
   "metadata": {},
   "source": [
    "## 先看一个高度集成的工具，ollama"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "bcaac2db-3920-47cf-a1db-67bd91f78422",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: ollama in /home/kyle/anaconda3/lib/python3.11/site-packages (0.1.9)\n",
      "Requirement already satisfied: httpx<0.28.0,>=0.27.0 in /home/kyle/anaconda3/lib/python3.11/site-packages (from ollama) (0.27.0)\n",
      "Requirement already satisfied: anyio in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (4.2.0)\n",
      "Requirement already satisfied: certifi in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (2024.2.2)\n",
      "Requirement already satisfied: httpcore==1.* in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (1.0.5)\n",
      "Requirement already satisfied: idna in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (3.4)\n",
      "Requirement already satisfied: sniffio in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (1.3.0)\n",
      "Requirement already satisfied: h11<0.15,>=0.13 in /home/kyle/anaconda3/lib/python3.11/site-packages (from httpcore==1.*->httpx<0.28.0,>=0.27.0->ollama) (0.14.0)\n",
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    }
   ],
   "source": [
    "# conda uninstall -c conda-forge ollama\n",
    "# pip --version\n",
    "\n",
    "%pip install ollama"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "92b2d092-f61e-45c9-bff4-c1047fc2fa1f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OpenAtom Open Source Foundation is a non-profit organization that aims to promote open source collaboration and innovation in the fields of chemistry, materials science, and related areas. Here are some open source projects under the OpenAtom umbrella:\n",
      "\n",
      "1. **Open Babel**: An open-source chemical toolbox that provides algorithms for molecular manipulation and conversion between different file formats.\n",
      "2. **Gaussian**: A widely used quantum chemistry program package that can be used to simulate various physical and chemical phenomena, such as molecular structure, thermodynamics, and spectroscopy.\n",
      "3. **CP2K**: A quantum chemistry software package that uses density functional theory (DFT) and other methods to study the properties of molecules and materials.\n",
      "4. **Siesta**: An open-source software package for electronic structure calculations and material simulations based on Density Functional Theory (DFT).\n",
      "5. **VASP**: A Vienna Ab-Initio Simulation Package for calculating various physical properties of crystalline solids, such as lattice constants, phonon spectra, and electrical conductivity.\n",
      "6. **ESPResSo**: An open-source software package for molecular dynamics simulations that can be used to study the behavior of molecules in solution or at interfaces.\n",
      "7. **PLUMED**: A software package for analyzing and visualizing the results of molecular dynamics simulations.\n",
      "\n",
      "These projects are designed to facilitate collaboration, innovation, and knowledge sharing among researchers in the fields of chemistry, materials science, and related areas. By making these tools open source, the OpenAtom Foundation aims to promote transparency, reproducibility, and advancement in scientific research.\n"
     ]
    }
   ],
   "source": [
    "import ollama\n",
    "response = ollama.chat(model='llama3', messages=[\n",
    "  {\n",
    "    'role': 'user',\n",
    "    'content': \"开放原子开源基金会有哪些开源项目，用中文回答\",\n",
    "  },\n",
    "])\n",
    "print(response['message']['content'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2ade9fe8-52dd-45fc-a6fd-21398139f641",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a10ffae8-d889-4eb4-918a-fc9735da4afb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
=======
version https://git-lfs.github.com/spec/v1
oid sha256:a4d62de57fb925289f0bf673ce783053757a9df1d90ea21f8ddcf7ecb0e9534f
size 3247
>>>>>>> origin/master
